<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/



Route::get('/','IndexController@index');
Route::get('/home','IndexController@index')->name('home');
Route::namespace('Auth')->group(function(){
    // 注册路由
    Route::get('register','RegisterController@showRegistrationForm');
    Route::post('register','RegisterController@register')->middleware('mail');
    // 登录
    Route::get('login','LoginController@showLoginForm')->name('login');
    Route::post('login','LoginController@login');
    // 退出
    Route::get('logout','LoginController@logout');
});
Route::middleware('auth')->group(function(){
    // 申请路由
    Route::get('/jie','ProController@jie');
    Route::post('/jie','ProController@jiePost');
    // 投资路由
    Route::get('touzi/{pid}','ProController@touzi');
    Route::post('touzi/{pid}','ProController@touziPost');
    // 打款
    Route::get('grow','GrowController@grow');
    Route::get('myzd','ProController@myzd');
    Route::get('mysy','ProController@mysy');
    Route::get('mytz','ProController@mytz');
    // 在线支付
    ROute::post('pay',function(){
        $data = [];
        $data['v_amount'] = 0.01;
        $data['v_moneytype'] = 'CNY';
        $data['v_oid'] = date('YmdHis').mt_rand(1000,9999);
        $data['v_mid'] = '20272562';
        $data['v_url'] = "http://www.baidu.com";
        $data['v_key'] = '%()#QOKFDLS:1*&U';
        $data['v_md5info'] = strtoupper(md5(implode($data)));
        return view('pay',$data);
    });
});
// 审核列表路由
Route::get('prolist','CheckController@prolist');
// 审核路由
Route::get('check/{pid}','CheckController@check');
Route::post('check/{pid}','CheckController@checkPost');


